package com.example.gradledemo;

import android.app.Application;
import android.content.Context;
import android.content.res.AssetManager;
import com.appinit.lib.AppInitialManager;
import com.appinit.lib.annotation.AppInitial;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * @author GYL
 * @dateTime 2020/5/19-17:02
 * @description
 */
@AppInitial
public class App extends Application {
  
  
  
  @Override
  public void onCreate() {
    super.onCreate();
  
//    AssetManager mAssetManger = getAssets();
//    InputStream ins=null;
//    ByteArrayOutputStream outs;
//    try {
//      ins = mAssetManger.open("initList.json");
//      outs = new ByteArrayOutputStream();
//      byte buf[] = new byte[1024];
//      int len;
//      try {
//        while ((len = ins.read(buf)) != -1) {
//          outs.write(buf, 0, len);
//        }
//        outs.close();
//        ins.close();
//      } catch (IOException e) {
//      }
//
//      String json= outs.toString("UTF-8");
//      AppInitialManager.addInitList(json);
//
//    } catch (IOException e) {
//      e.printStackTrace();
//    }
//    AppInitialManager.onInit(this);
  
  }
  
  @Override
  public void onTerminate() {
    super.onTerminate();
  }
  
  @Override
  public void onTrimMemory(int level) {
    super.onTrimMemory(level);
  }
  
  @Override
  protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
  }
}
